const Service = require('../services/label.service');
class LabelContainer{
 async  createLabel(ctx,next){
  const {name} = ctx.request.body;
  // const {labels} = ctx.request.body;
  // const isExist = await Service.hasLabel(name);
  const result = await Service.createLabel(name);
  ctx.body={
    code:200,
    data:result
  }
  }
  async  getLabelList(ctx, next){
   const {limit,offset} = ctx.query;
    const result = await Service.getLabels(limit,offset);
    ctx.body={
      code:200,
      data:result
    }
  }
}
module.exports =new LabelContainer();